/**
 *
 */
package gemini.pollux.ui.client;

import gemini.pollux.ui.client.service.LevelService;
import gemini.pollux.ui.client.service.LevelServiceAsync;
import gemini.pollux.ui.client.service.ProductService;
import gemini.pollux.ui.client.service.ProductServiceAsync;
import gemini.pollux.ui.client.service.ProductTypeService;
import gemini.pollux.ui.client.service.ProductTypeServiceAsync;
import gemini.pollux.ui.client.service.UserService;
import gemini.pollux.ui.client.service.UserServiceAsync;

import com.google.gwt.core.client.GWT;

/**
 * The class define accessor methods to get RPC services.
 *
 */
public final class ServiceCatalog {

    private ServiceCatalog() {
    }

    private static UserServiceAsync userService;
    private static LevelServiceAsync levelService;
    private static ProductTypeServiceAsync productTypeService;
    private static ProductServiceAsync productService;
    
    public static final ProductTypeServiceAsync getProductTypeService() {
        if (productTypeService == null) {
        	productTypeService = GWT.create(ProductTypeService.class);
        }
        return productTypeService;
    }
    
    public static final ProductServiceAsync getProductService() {
        if (productService == null) {
        	productService = GWT.create(ProductService.class);
        }
        return productService;
    }

    public static final UserServiceAsync getUserService() {
        if (userService == null) {
        	userService = GWT.create(UserService.class);
        }
        return userService;
    }
    
    public static final LevelServiceAsync getLevelService() {
        if (levelService == null) {
        	levelService = GWT.create(LevelService.class);
        }
        return levelService;
    }
}
